package dl.jf.dao.impl;

import java.util.ArrayList;


import dl.jf.common.model.MRecord;
import dl.jf.common.model.MSubRecord;
import dl.jf.dao.idao.IRecordDao;

public class RecordDaoImpl extends BaseDaoImpl implements IRecordDao {

	@SuppressWarnings("unchecked")
	@Override
	public ArrayList<MRecord> getRecordList(MRecord record) {
		return (ArrayList<MRecord>) getSqlMapClientTemplate().queryForList(
				"recordSQL.getRecordList", record);
	}

	public void saveSubRecord(MSubRecord subRecord) {
		getSqlMapClientTemplate().insert(
				"recordSQL.saveSubRecord", subRecord);
	}

	public void deleteSubRecord(String recordId) {
		getSqlMapClientTemplate().delete(
				"recordSQL.deleteSubRecord", recordId);
	}

	public void saveRecord(MRecord record) {
		getSqlMapClientTemplate().insert(
				"recordSQL.saveRecord", record);
	}
}
